package com.film.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.film.domain.Film;
import com.film.service.FilmService;
import com.film.service.impl.FilmServiceImpl;
/**
 * 该控制类用来做即将上映的电影的查询
 * @author 2119196781
 *
 */
@WebServlet("/showFilm.do")
public class ShowFilmController extends HttpServlet{
	private FilmService filmService = new FilmServiceImpl();
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		//冷门电影
			HttpSession session = request.getSession();
			List<Film> showFilm = filmService.selectShowFilm();
			session.setAttribute("films", showFilm);
			session.setAttribute("film", showFilm);
			session.setAttribute("filmSize", showFilm.size());
			response.sendRedirect("showFilm.jsp?flag1=-1&flag2=-1&flag3=-1&flage=1&flag4=-1&flag=1");
	}
}
